﻿using System;
using System.Linq;

namespace MartinRL.ProjectEuler
{
    /// <summary>
    /// http://projecteuler.net/index.php?section=problems&id=5
    /// </summary>
    public static class Problem005
    {
        public static int FindTheSmallestPositiveNumberThatIsEvenlyDivisibleByAllOfTheNumbersFrom1To20()
        {
            return 1.ToMax()
                .Where(t => t.IsEven())
                .First(t => t.IsEvenlyDivisibleBy(11.To(20).ToArray()));
        }
    }
}